package com.awesome.kotlindemo.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.awesome.common.util.log.ShowLogUtil
import com.awesome.kotlindemo.R
import com.awesome.kotlindemo.bean.Person
import com.awesome.kotlindemo.bean.Fruit
import com.awesome.kotlindemo.bean.Grape

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2021/11/25
 * Description:基础语言
 */
class LanguageActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_language)

        // 配置对象的属性
        val languages  = BaseLanguage().apply {
            x = 9
        }

        // 关键字with代码块可以直接调用该实例的方法
        with(languages){
            languages.main()
            ShowLogUtil.info(getString(1))
            ShowLogUtil.info(tryCatch())
        }

        Person("Jane", "23234@qq.com")
        Fruit();
        Fruit("violet");
        Fruit("violet","Grape");
        Grape("violet")
        Grape("violet", "Grape")
        Grape("Shandong");
        Grape("Shandong","hugePeak");
    }
}